package com.yuhanginfo.modules.web.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yuhanginfo.common.persistence.Page;
import com.yuhanginfo.common.service.WebCrudService;
import com.yuhanginfo.modules.web.dao.WebCreditDao;
import com.yuhanginfo.modules.web.entity.WebCredit;

/**
 * 信用额度Service
 * @author lvls
 * @version 2017-09-21
 */
@Service
@Transactional(readOnly = true)
public class WebCreditService extends WebCrudService<WebCreditDao, WebCredit> {

	@Autowired
	private WebCreditDao creditDao;
	
	public WebCredit get(String id) {
		return super.get(id);
	}
	
	public List<WebCredit> findList(WebCredit credit) {
		return super.findList(credit);
	}
	
	public Page<WebCredit> findPage(Page<WebCredit> page, WebCredit credit) {
		return super.findPage(page, credit);
	}
	
	@Transactional(readOnly = false)
	public void save(WebCredit credit) {
		super.save(credit);
	}
	
	@Transactional(readOnly = false)
	public void delete(WebCredit credit) {
		super.delete(credit);
	}

	public WebCredit selectByUserId(Integer userId) {
		return creditDao.selectByUserId(userId);
	}

	public int changeStatus(WebCredit credit) {
		return creditDao.changeStatus(credit);
	}
    
	@Transactional(readOnly = false)
	public void updateUseMoney(WebCredit credit) {
		creditDao.updateUseMoney(credit);
		
	}

	
}